import psutil

# 获取CPU信息
cpus = psutil.cpu_times(percpu=True)
print(f"CPU times: {cpus}")

# 获取内存信息
memory = psutil.virtual_memory()
print(f"Total memory: {int(memory.total / 1024 ** 2)} MB")

# 获取存储信息
storage = psutil.disk_usage('/')
print(f"Total disk space: {int(storage.total / 1024 ** 2)} MB")

# 获取网络信息
net = psutil.net_io_counters()
print(f"Bytes sent: {net.bytes_sent}, Bytes received: {net.bytes_recv}")